<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    123
    <script>
        const a = {
            name: 'aname',
            getNameObj() {
                return {
                    name: 'saner',
                    getName: () => {
                        console.log(this.name);
                    },
                    getNameMe: () => {
                        console.log(this.name);
                    }
                }
            }
        }
        const b = {
            name: 'sier'
        }
        const c = a.getNameObj();
        b.getName = a.getNameObj().getName;
        b.getNameMe = a.getNameObj().getNameMe;
        b.getName();  //
        b.getNameMe();//
        c.getName();  //
        c.getNameMe();//
    </script>
</body>
</html>